package org.kl.bpm.entity.conf;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.kl.bf.entity.IdEntity;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 流程定义基础, 获取Activiti中流程定义信息
 * 
 * @Author hqm
 * @CreateTime 2014年5月25日 下午6:09:44
 */
@Entity
@Table(name = "BPM_CONF_BASE")
public class BpmConfBase extends IdEntity {
	private static final long serialVersionUID = 0L;
	private String processDefinitionId;
	private String processDefinitionKey;
	private String processDefinitionName;
	private Integer processDefinitionVersion;
	private Set<BpmConfNode> bpmConfNodes = new HashSet<BpmConfNode>(0);
	private Set<BpmProcess> bpmProcesses = new HashSet<BpmProcess>(0);

	public BpmConfBase() {
	}

	public BpmConfBase(String processDefinitionId, String processDefinitionKey, Integer processDefinitionVersion,
			Set<BpmConfNode> bpmConfNodes, Set<BpmProcess> bpmProcesses) {
		this.processDefinitionId = processDefinitionId;
		this.processDefinitionKey = processDefinitionKey;
		this.processDefinitionVersion = processDefinitionVersion;
		this.bpmConfNodes = bpmConfNodes;
		this.bpmProcesses = bpmProcesses;
	}

	@Column(name = "PROCESS_DEFINITION_ID", length = 200)
	public String getProcessDefinitionId() {
		return this.processDefinitionId;
	}

	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}

	@Column(name = "PROCESS_DEFINITION_KEY", length = 200)
	public String getProcessDefinitionKey() {
		return this.processDefinitionKey;
	}

	public void setProcessDefinitionKey(String processDefinitionKey) {
		this.processDefinitionKey = processDefinitionKey;
	}

	@Column(name = "PROCESS_DEFINITION_NAME", length = 200)
	public String getProcessDefinitionName() {
		return processDefinitionName;
	}

	public void setProcessDefinitionName(String processDefinitionName) {
		this.processDefinitionName = processDefinitionName;
	}

	@Column(name = "PROCESS_DEFINITION_VERSION")
	public Integer getProcessDefinitionVersion() {
		return this.processDefinitionVersion;
	}

	public void setProcessDefinitionVersion(Integer processDefinitionVersion) {
		this.processDefinitionVersion = processDefinitionVersion;
	}

	@JsonIgnore
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "bpmConfBase")
	public Set<BpmConfNode> getBpmConfNodes() {
		return this.bpmConfNodes;
	}

	public void setBpmConfNodes(Set<BpmConfNode> bpmConfNodes) {
		this.bpmConfNodes = bpmConfNodes;
	}

	@JsonIgnore
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "bpmConfBase")
	public Set<BpmProcess> getBpmProcesses() {
		return this.bpmProcesses;
	}

	public void setBpmProcesses(Set<BpmProcess> bpmProcesses) {
		this.bpmProcesses = bpmProcesses;
	}
}
